<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/common/head.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!doctype html>
<html>
<head>
		<meta charset="UTF-8">
		<title>日志查看</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link rel="stylesheet" href="${resource }/css/bootstrap.css" />
		<link rel="stylesheet" href="${resource }/css/styles.css" />
		<script src="${resource }/js/jquery-2.1.1.min.js"></script>
		<script src="${resource }/js/bootstrap.min.js?v=3.4.0"></script>
		<style type="text/css">
			a:hover{
				text-decoration: none;
			}
			
		</style>
</head>
<body>
	 <div class="mainContent">
	    <aside>
	      <div class="avatars">
	        <a href="#"><span><img src="${resource }/img/photo.jpg"></span></a>
	      </div>
	      <section class="topspaceinfo">
	        <h1 align="center" id="username">${user.getUserName() }</h1>
	      </section> 
	      <div class="userinfo"> 
	        <p class="q-fans"> 评论人数  <a href="#" target="_blank">${log.getCommentNum() }</a></p> 
	        <c:if test="${log.getIsPerson()==1 }">
	        	<c:set var="category" value="个人日志"></c:set>
	        </c:if>
	        <c:if test="${log.getIsPerson()==0 }">
	        	<c:set var="category" value="工作日志"></c:set>
	        </c:if>
	        <p class="btns"><a href="#" target="_blank" >女</a><a href="#" target="_blank">${dept.getDeptName() }</a><a href="show.do" target="main">${category }</a></p>   
	      </div>
	     <!-- <section class="newpic">
	         <h2>个人相册</h2>
	         <ul>
	           <li><a href="/"><img src="images/01.jpg"></a></li>
	           <li><a href="/"><img src="images/02.jpg"></a></li>
	           <li><a href="/"><img src="images/03.jpg"></a></li>
	           <li><a href="/"><img src="images/04.jpg"></a></li>
	           <li><a href="/"><img src="images/05.jpg"></a></li>
	           <li><a href="/"><img src="images/06.jpg"></a></li>
	           <li><a href="/"><img src="images/07.jpg"></a></li>
	           <li><a href="/"><img src="images/08.jpg"></a></li>
	         </ul>
	      </section>
	      <section class="taglist">
	         <h2>哈哈哈哈</h2>
	         <ul>
	           <li><a href="/">哈哈哈哈</a></li>
	           <li><a href="/">哈哈哈哈</a></li>
	           <li><a href="/">study</a></li>
	           <li><a href="/">哈哈哈哈</a></li>
	        </ul>
	      </section>-->
	    </aside>
	    <div class="blogitem">
	      <article>
	        <h2 class="title"><a href="#">${log.getLogTitle() }</a><h5><span class="pull-right font-noraml">${log.getDate() }</span></h5></h2>
	        <ul class="text">
	          <p>${log.getLogInfo() }</p>
	          <p class="textimg"><img src="${resource }/img/text02.jpg"></p>
	        </ul>
	        <div class="textfoot">
	        	<form action="" method="post">
	         	 <div class="input-group">
				  <input type="text" id="commentInfo" class="form-control" placeholder="用戶评论" aria-describedby="basic-addon2">
				  <span class="input-group-addon" id="basic-addon2"><a href="#" onclick="comment('${log.id}','${user.id }')">评论</a></span>
				</div>
				
	          </form>
	        </div>
	      </article> 
	    </div>
	 </div>
	<footer>
	   <div class="footavatar">
	     <img src="${resource }/img/photo.jpg" class="footphoto">
	     <ul class="footinfo">
	       <p class="fname"><a href="/back0806/person/show.do?sign=0" >个人主页</a></p>
	       <p class="finfo">${user.getUserName() }</p>
	       <p>${dept.getDeptName() }</p></ul>
	   </div>
	   <div class="Copyright">
	     <ul>
	       <a href="#">源</a><a href="#">族</a><a href="#">崛</a><a href="#">起</a>
	     </ul>
	     <p>Design by 源族崛起</p>
	   </div>
	 </footer>
	<script type="text/javascript">
		function comment(a,b) {
			var logId=a;
			var userId=b;
			var commentInfo=document.getElementById("commentInfo").value;
			$.ajax({

				type: 'post',
				url: 'commentDo.do',
				data:{"logId":logId,"userId":userId,"commentInfo":commentInfo},
				success: function (data) {
					
						alert("评论成功");
						
					
				}
			});
			var obj = document.getElementById('commentInfo');
		    obj.outerHTML=obj.outerHTML;
		}
	</script>
</body>
</html>